package file;

import java.io.File;
import java.io.FileFilter;

public class Test2 {
    public static void main(String[] args) {
        File dir = new File(".");
        if(dir.isDirectory()){
            File[] subs = dir.listFiles(new FileFilter() {
                @Override
                public boolean accept(File pathname) {
                    String name = pathname.getName();
                    return name.startsWith("test");
                }
            });
            for (File sub : subs){
                System.out.println(sub.getName());
            }
        }
    }
}
